package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.example.demo.dao.StudentDao;
import com.example.demo.entity.Student;

@Controller
public class StudentController {

	
	@Autowired
	StudentDao studentDao;
	
	@RequestMapping("/save")
	public String saveEn() {
		Student student=new Student();
		
		student.setId(55);
		student.setAge("22");
		student.setName("lllllll");
		
		try {
			studentDao.save(student);
		}catch (Exception e) {
			e.printStackTrace();
		} finally {
			System.out.println("执行了");
		}
		
		return "Complete！";
	}
}
